import subprocess

# 
# wifi密码
# 

def a1():
	with open("passwd.txt","r") as f:
		f=f.read().split("\n")
	i=0
	count=len(f)
	while True:
		if i<count:
			try:
				result=subprocess.run(["nmcli","device","wifi","connect","UFI-053669","password",f[i]],timeout=3)	
				if result:
					print(f"成功:{f[i]}")
					break
			except subprocess.TimeoutExpired as e:
				print(f"失败{e}")
		i=i+1
if __name__ == '__main__':
	a1()
	